#从DNS服务器获取IPv6地址
import dns.resolver
f_read = open("./result/full_edu.txt",'r')
f_write = open("./result/edu_useful_6.txt",'w')

while True:
    domain = f_read.readline().replace('\n','')
    print('1.'+domain)
    if len(domain)==0:
        break
    else:
        try:
            result = dns.resolver.query(domain,'AAAA')
            for i in result.response.answer:
                    for j in i.items:
                        if j.rdtype == 28:
                            f_write.write(domain+','+j.address+'\n')
        except:
            continue
f_read.close()
f_write.close()
print("finish")